import request from '@/utils/request'

const baseUrl = '/food'

// 获取分页列表
export function list(params) {
  return request({
    url: baseUrl + '/list',
    method: 'get',
    params: params
  })
}

// 保存
export function save(params) {
  return request({
    url: baseUrl + '/save',
    method: 'post',
    data: params
  })
}

// 删除
export function deleteFood(params) {
  return request({
    url: baseUrl + '/delete',
    method: 'get',
    params: params
  })
}

// 获取详情
export function getDetail(params) {
  return request({
    url: baseUrl + '/getDetail',
    method: 'get',
    params: params
  })
}

// 下载导入模板
export function downloadImportTemplate(params) {
  return request({
    url: baseUrl + '/downloadImportTemplate',
    method: 'get',
    params: params
  })
}

// 导入
export function importExcel(params) {
  return request({
    url: baseUrl + '/import',
    method: 'post',
    data: params
  })
}
